<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>顶部导航栏</title>
    <link th:href="@{/webjars/bootstrap/4.3.1/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

</head>

<body>
    <div th:fragment="top">
        <nav id="top">
            <!--<span id="logo"><img th:src="@{/img/blog-logo.png}"/></span>-->
            <span id="logo"><img th:src="@{/img/photo.jpg}"/></span>
            <a th:href="@{/main}">首页</a>
            <a th:href="@{/write}">写博客</a>
            <!--<a th:href="@{'/person/' + ${session.loginUser.userId}}" th:if="${session.loginUser != null}">个人主页</a>-->
            <!--<a th:href="@{/forum}">论坛</a>-->
            <a th:href="@{/search}">搜索</a>

            <span class="dropdown" style="float: right; margin-right: 50px;"
                  th:if="${session.loginUser != null}">
                <span class="dropbtn">
                    <a th:href="@{'/person/' + ${session.loginUser.userId}}" id="user"
                        th:text="${session.loginUser.userName}">
                    </a>
                </span>
                <div class="dropdown-content">
                    <a th:href="@{'/person/' + ${session.loginUser.userId}}">个人中心</a>
                    <a th:href="@{'/settings'}">账号设置</a>
                    <!--<a th:href="@{'/password/resetting'}">修改密码</a>-->
                    <a th:href="@{/sign_out}">退出</a>
                </div>
            </span>
            <!--session.loginUser.userId-->


            <span style="float: right; margin-right: 50px;">
                <a th:href="@{/}" th:if="${session.loginUser == null}">登录/注册</a>
            </span>

        </nav>
    </div>
</body>

    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/jquery.min.js}"></script>

</html>